﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace TanashCMS.Business.Utility
{
    public class Sanitiser
    {
        public static string AlphaNumeric(string value, string allowedChars)
        {
            return Regex.Replace(value, string.Format(@"[^\w-_{0}]", allowedChars), "");
        }

        public static string AlphaNumeric(string value)
        {
            return AlphaNumeric(value, "");
        }

        public static string Alpha(string value)
        {
            return Regex.Replace(value, @"[\W]", "");
        }
    }
}
